/*
package cn.itcast.poi.task;

import cn.itcast.poi.entity.User;
import cn.itcast.poi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.concurrent.*;

*/
/**
 * @author zhanghuan
 * @date 2020/9/12 10:52
 * @description
 *//*

@Component
public class ValidateExcelDataTask extends RecursiveTask<List<User>> {

    @Autowired
    private UserService userService;

    private static final Integer MAX = 50;


    */
/**
     * 子任务开始计算的序号
     *//*

    private Integer start;

    */
/**
     * 子任务结束计算的序号
     *//*

    private Integer end;


    public ValidateExcelDataTask(Integer start, Integer end) {
        this.start = start;
        this.end = end;
    }

    @Override
    protected List<User> compute() {
        if (end - start < MAX) {
            //小于边界值,直接进行校验
            userService.
        } else {
            List<User> resultUserList = new CopyOnWriteArrayList<>();
            ValidateExcelDataTask validateExcelDataTask1 = new ValidateExcelDataTask(start, (start + end) / 2);
            validateExcelDataTask1.fork();
            ValidateExcelDataTask validateExcelDataTask2 = new ValidateExcelDataTask((start + end) / 2 + 1, end);
            validateExcelDataTask2.fork();
            List<User> userList1 = validateExcelDataTask1.join();
            List<User> userList2 = validateExcelDataTask2.join();
            resultUserList.addAll(userList1);
            resultUserList.addAll(userList2);
            return resultUserList;
        }

    }

    public static void main(String[] args) {
        ForkJoinPool pool = new ForkJoinPool();
        Future<List<User>> taskFuture = pool.submit(new ValidateExcelDataTask(1, 1000));

    }
}
*/
